package com.lagou.edu.service.impl;

import com.lagou.edu.dao.ResumeDao;
import com.lagou.edu.pojo.Resume;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author yangpeng
 * @time 2020/3/14
 * @since 1.0.0
 */
@Transactional
@Service
public class ResumeImpl implements ResumeService {

    @Autowired
    ResumeDao resumeDao;

    @Override
    public boolean addResume(Resume resume) {
        resumeDao.save(resume);
        return true;
    }

    @Override
    public boolean updateResume(Resume resume) {
        resumeDao.save(resume);
        return true;
    }

    @Override
    public boolean deleteResume(Long id) {

        resumeDao.delete(id);
        return true;
    }

    @Override
    public List<Resume> queryAllList() {
        return resumeDao.findAll();
    }

    @Override
    public Resume findById(long i) {
        Resume one = resumeDao.findOne(i);
        return one;
    }
}
